using System;
using WebServiceTI.BusinessEntities;
using WebServiceTI.DataContracts;

namespace WebServiceTI.ServiceImplementation
{
    public static class TranslateBetweenTaskAndTask
    {
        public static WebServiceTI.BusinessEntities.Task TranslateTaskToTask(WebServiceTI.DataContracts.Task from)
        {
            WebServiceTI.BusinessEntities.Task to = new WebServiceTI.BusinessEntities.Task();
            to.Name = from.Name;
            to.Descryption = from.Descryption;
            to.Create_date = from.Create_date;
            to.Owner = TranslateBetweenPersonalDataAndPersonalData.TranslatePersonalDataToPersonalData(from.Owner);
            return to;
        }

        public static WebServiceTI.DataContracts.Task TranslateTaskToTask(WebServiceTI.BusinessEntities.Task from)
        {
            WebServiceTI.DataContracts.Task to = new WebServiceTI.DataContracts.Task();
            to.Name = from.Name;
            to.Descryption = from.Descryption;
            to.Create_date = from.Create_date;
            to.Owner = TranslateBetweenPersonalDataAndPersonalData.TranslatePersonalDataToPersonalData(from.Owner);
            return to;
        }
    }
}

